/**
 * 
 */
package com.swg.cocobox.filetransfer.command;

import com.swg.cocobox.filetransfer.internal.ClientCommandBuilder;
import com.swg.cocobox.filetransfer.internal.ClientCommandParser;

/**
 * @author satriaprayoga
 *
 */
public abstract class ClientCommandFactory implements CommandFactory {

	protected final ClientCommandBuilder builder;
	protected final ClientCommandParser parser;
	
	public ClientCommandFactory(ClientCommandBuilder builder,ClientCommandParser parser) {
		this.builder=builder;
		this.parser=parser;
	}
	public ClientCommand createCommand(String code,String message){
		return builder.buildCommand(code, message);
	}
	
	@Override
	public ClientCommand parseCommand(byte[] data){
		return parser.parseCommand(data);
	}
	
}
